import formBuilder from "@/comps/form/formBuilder";
import api from "./api";
import apiItemSku from "@/pages/v1/wms/ItemSku/js/api";
import apiIOType from "@/pages/v1/wms/IOType/js/api";

export default {
    main:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)
        fb.addCascade("typeId","入库类型",3)
            .setApi(apiIOType.urlTree)
            .setApiParams({root:1})
        fb.addSearch("itemId","物料",9).setApi(apiItemSku.urlChoice)
            .setApiSearchKeys(["text__like","code__like"])

        fb.addText("sn","单号",3).setRules([fb.R.notNull()])
        fb.addText("batchCode","批次号",3)
        fb.addText("heapCode","堆号",3)
        fb.addText("pos","库位号",3)
        fb.addText("numIn","入库数量",3).setTypeNumber()
        fb.addText("numOut","出库数量",3).setTypeNumber()
        fb.addText("numLeft","剩余数量",3).setTypeNumber()
        fb.addText("cost","总价值",3).setTypeNumber()
        fb.addSwitch("isCanceled","是否冲红",3)
        fb.addText("supplier","供应商",12)
        fb.addText("brand","品牌",12)
        fb.addText("note","备注",12).setMulti(true).setRows(3)


        return fb
    },
    other:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100).setLabelPosition("right")

        return fb
    }
}